# -*- coding: UTF-8 -*-
"""
@author: tgy
@file: exception_demo.py
@time: 2021/02/03
"""

class MyException(Exception):
    ...
    # def __init__(self,code,message):
    #     ...
    #     self.code = code
    #     self.message = message
        # super().__init__(code, message)
    def __str__(self):
        return 'xxx'

def test01():
    ...
    try:
        # raise MyException(code=201, message='哈哈')
        raise MyException
    except MyException as myException:
        ...
        print(myException)
        import sys
        print(sys.exc_info())
        # print(myException.args)
        # print(myException)



if __name__ == '__main__':
    pass
    test01()
